package com.ayitubie.refuelweb.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
/**
*
*  @author author
*/
public class test implements Serializable {

    private static final long serialVersionUID = 1704871773355L;


    /**
    * 主键
    * 
    * isNullAble:0
    */
    private Integer stationId;

    /**
    * 
    * isNullAble:0
    */
    private String stationName;

    /**
    * 
    * isNullAble:0
    */
    private String stationAddress;

    /**
    * 
    * isNullAble:0
    */
    private java.time.LocalDateTime createTime;

    /**
    * 
    * isNullAble:0
    */
    private java.time.LocalDateTime updateTime;


    public void setStationId(Integer stationId){this.stationId = stationId;}

    public Integer getStationId(){return this.stationId;}

    public void setStationName(String stationName){this.stationName = stationName;}

    public String getStationName(){return this.stationName;}

    public void setStationAddress(String stationAddress){this.stationAddress = stationAddress;}

    public String getStationAddress(){return this.stationAddress;}

    public void setCreateTime(java.time.LocalDateTime createTime){this.createTime = createTime;}

    public java.time.LocalDateTime getCreateTime(){return this.createTime;}

    public void setUpdateTime(java.time.LocalDateTime updateTime){this.updateTime = updateTime;}

    public java.time.LocalDateTime getUpdateTime(){return this.updateTime;}
    @Override
    public String toString() {
        return "test{" +
                "stationId='" + stationId + '\'' +
                "stationName='" + stationName + '\'' +
                "stationAddress='" + stationAddress + '\'' +
                "createTime='" + createTime + '\'' +
                "updateTime='" + updateTime + '\'' +
            '}';
    }

    public static Builder Build(){return new Builder();}

    public static ConditionBuilder ConditionBuild(){return new ConditionBuilder();}

    public static UpdateBuilder UpdateBuild(){return new UpdateBuilder();}

    public static QueryBuilder QueryBuild(){return new QueryBuilder();}

    public static class UpdateBuilder {

        private test set;

        private ConditionBuilder where;

        public UpdateBuilder set(test set){
            this.set = set;
            return this;
        }

        public test getSet(){
            return this.set;
        }

        public UpdateBuilder where(ConditionBuilder where){
            this.where = where;
            return this;
        }

        public ConditionBuilder getWhere(){
            return this.where;
        }

        public UpdateBuilder build(){
            return this;
        }
    }

    public static class QueryBuilder extends test{
        /**
        * 需要返回的列
        */
        private Map<String,Object> fetchFields;

        public Map<String,Object> getFetchFields(){return this.fetchFields;}

        private List<Integer> stationIdList;

        public List<Integer> getStationIdList(){return this.stationIdList;}

        private Integer stationIdSt;

        private Integer stationIdEd;

        public Integer getStationIdSt(){return this.stationIdSt;}

        public Integer getStationIdEd(){return this.stationIdEd;}

        private List<String> stationNameList;

        public List<String> getStationNameList(){return this.stationNameList;}


        private List<String> fuzzyStationName;

        public List<String> getFuzzyStationName(){return this.fuzzyStationName;}

        private List<String> rightFuzzyStationName;

        public List<String> getRightFuzzyStationName(){return this.rightFuzzyStationName;}
        private List<String> stationAddressList;

        public List<String> getStationAddressList(){return this.stationAddressList;}


        private List<String> fuzzyStationAddress;

        public List<String> getFuzzyStationAddress(){return this.fuzzyStationAddress;}

        private List<String> rightFuzzyStationAddress;

        public List<String> getRightFuzzyStationAddress(){return this.rightFuzzyStationAddress;}
        private List<java.time.LocalDateTime> createTimeList;

        public List<java.time.LocalDateTime> getCreateTimeList(){return this.createTimeList;}

        private java.time.LocalDateTime createTimeSt;

        private java.time.LocalDateTime createTimeEd;

        public java.time.LocalDateTime getCreateTimeSt(){return this.createTimeSt;}

        public java.time.LocalDateTime getCreateTimeEd(){return this.createTimeEd;}

        private List<java.time.LocalDateTime> updateTimeList;

        public List<java.time.LocalDateTime> getUpdateTimeList(){return this.updateTimeList;}

        private java.time.LocalDateTime updateTimeSt;

        private java.time.LocalDateTime updateTimeEd;

        public java.time.LocalDateTime getUpdateTimeSt(){return this.updateTimeSt;}

        public java.time.LocalDateTime getUpdateTimeEd(){return this.updateTimeEd;}

        private QueryBuilder (){
            this.fetchFields = new HashMap<>();
        }

        public QueryBuilder stationIdBetWeen(Integer stationIdSt,Integer stationIdEd){
            this.stationIdSt = stationIdSt;
            this.stationIdEd = stationIdEd;
            return this;
        }

        public QueryBuilder stationIdGreaterEqThan(Integer stationIdSt){
            this.stationIdSt = stationIdSt;
            return this;
        }
        public QueryBuilder stationIdLessEqThan(Integer stationIdEd){
            this.stationIdEd = stationIdEd;
            return this;
        }


        public QueryBuilder stationId(Integer stationId){
            setStationId(stationId);
            return this;
        }

        public QueryBuilder stationIdList(Integer ... stationId){
            this.stationIdList = solveNullList(stationId);
            return this;
        }

        public QueryBuilder stationIdList(List<Integer> stationId){
            this.stationIdList = stationId;
            return this;
        }

        public QueryBuilder fetchStationId(){
            setFetchFields("fetchFields","stationId");
            return this;
        }

        public QueryBuilder excludeStationId(){
            setFetchFields("excludeFields","stationId");
            return this;
        }

        public QueryBuilder fuzzyStationName (List<String> fuzzyStationName){
            this.fuzzyStationName = fuzzyStationName;
            return this;
        }

        public QueryBuilder fuzzyStationName (String ... fuzzyStationName){
            this.fuzzyStationName = solveNullList(fuzzyStationName);
            return this;
        }

        public QueryBuilder rightFuzzyStationName (List<String> rightFuzzyStationName){
            this.rightFuzzyStationName = rightFuzzyStationName;
            return this;
        }

        public QueryBuilder rightFuzzyStationName (String ... rightFuzzyStationName){
            this.rightFuzzyStationName = solveNullList(rightFuzzyStationName);
            return this;
        }

        public QueryBuilder stationName(String stationName){
            setStationName(stationName);
            return this;
        }

        public QueryBuilder stationNameList(String ... stationName){
            this.stationNameList = solveNullList(stationName);
            return this;
        }

        public QueryBuilder stationNameList(List<String> stationName){
            this.stationNameList = stationName;
            return this;
        }

        public QueryBuilder fetchStationName(){
            setFetchFields("fetchFields","stationName");
            return this;
        }

        public QueryBuilder excludeStationName(){
            setFetchFields("excludeFields","stationName");
            return this;
        }

        public QueryBuilder fuzzyStationAddress (List<String> fuzzyStationAddress){
            this.fuzzyStationAddress = fuzzyStationAddress;
            return this;
        }

        public QueryBuilder fuzzyStationAddress (String ... fuzzyStationAddress){
            this.fuzzyStationAddress = solveNullList(fuzzyStationAddress);
            return this;
        }

        public QueryBuilder rightFuzzyStationAddress (List<String> rightFuzzyStationAddress){
            this.rightFuzzyStationAddress = rightFuzzyStationAddress;
            return this;
        }

        public QueryBuilder rightFuzzyStationAddress (String ... rightFuzzyStationAddress){
            this.rightFuzzyStationAddress = solveNullList(rightFuzzyStationAddress);
            return this;
        }

        public QueryBuilder stationAddress(String stationAddress){
            setStationAddress(stationAddress);
            return this;
        }

        public QueryBuilder stationAddressList(String ... stationAddress){
            this.stationAddressList = solveNullList(stationAddress);
            return this;
        }

        public QueryBuilder stationAddressList(List<String> stationAddress){
            this.stationAddressList = stationAddress;
            return this;
        }

        public QueryBuilder fetchStationAddress(){
            setFetchFields("fetchFields","stationAddress");
            return this;
        }

        public QueryBuilder excludeStationAddress(){
            setFetchFields("excludeFields","stationAddress");
            return this;
        }

        public QueryBuilder createTimeBetWeen(java.time.LocalDateTime createTimeSt,java.time.LocalDateTime createTimeEd){
            this.createTimeSt = createTimeSt;
            this.createTimeEd = createTimeEd;
            return this;
        }

        public QueryBuilder createTimeGreaterEqThan(java.time.LocalDateTime createTimeSt){
            this.createTimeSt = createTimeSt;
            return this;
        }
        public QueryBuilder createTimeLessEqThan(java.time.LocalDateTime createTimeEd){
            this.createTimeEd = createTimeEd;
            return this;
        }


        public QueryBuilder createTime(java.time.LocalDateTime createTime){
            setCreateTime(createTime);
            return this;
        }

        public QueryBuilder createTimeList(java.time.LocalDateTime ... createTime){
            this.createTimeList = solveNullList(createTime);
            return this;
        }

        public QueryBuilder createTimeList(List<java.time.LocalDateTime> createTime){
            this.createTimeList = createTime;
            return this;
        }

        public QueryBuilder fetchCreateTime(){
            setFetchFields("fetchFields","createTime");
            return this;
        }

        public QueryBuilder excludeCreateTime(){
            setFetchFields("excludeFields","createTime");
            return this;
        }

        public QueryBuilder updateTimeBetWeen(java.time.LocalDateTime updateTimeSt,java.time.LocalDateTime updateTimeEd){
            this.updateTimeSt = updateTimeSt;
            this.updateTimeEd = updateTimeEd;
            return this;
        }

        public QueryBuilder updateTimeGreaterEqThan(java.time.LocalDateTime updateTimeSt){
            this.updateTimeSt = updateTimeSt;
            return this;
        }
        public QueryBuilder updateTimeLessEqThan(java.time.LocalDateTime updateTimeEd){
            this.updateTimeEd = updateTimeEd;
            return this;
        }


        public QueryBuilder updateTime(java.time.LocalDateTime updateTime){
            setUpdateTime(updateTime);
            return this;
        }

        public QueryBuilder updateTimeList(java.time.LocalDateTime ... updateTime){
            this.updateTimeList = solveNullList(updateTime);
            return this;
        }

        public QueryBuilder updateTimeList(List<java.time.LocalDateTime> updateTime){
            this.updateTimeList = updateTime;
            return this;
        }

        public QueryBuilder fetchUpdateTime(){
            setFetchFields("fetchFields","updateTime");
            return this;
        }

        public QueryBuilder excludeUpdateTime(){
            setFetchFields("excludeFields","updateTime");
            return this;
        }
        private <T>List<T> solveNullList(T ... objs){
            if (objs != null){
            List<T> list = new ArrayList<>();
                for (T item : objs){
                    if (item != null){
                        list.add(item);
                    }
                }
                return list;
            }
            return null;
        }

        public QueryBuilder fetchAll(){
            this.fetchFields.put("AllFields",true);
            return this;
        }

        public QueryBuilder addField(String ... fields){
            List<String> list = new ArrayList<>();
            if (fields != null){
                for (String field : fields){
                    list.add(field);
                }
            }
            this.fetchFields.put("otherFields",list);
            return this;
        }
        @SuppressWarnings("unchecked")
        private void setFetchFields(String key,String val){
            Map<String,Boolean> fields= (Map<String, Boolean>) this.fetchFields.get(key);
            if (fields == null){
                fields = new HashMap<>();
            }
            fields.put(val,true);
            this.fetchFields.put(key,fields);
        }

        public test build(){return this;}
    }


    public static class ConditionBuilder{
        private List<Integer> stationIdList;

        public List<Integer> getStationIdList(){return this.stationIdList;}

        private Integer stationIdSt;

        private Integer stationIdEd;

        public Integer getStationIdSt(){return this.stationIdSt;}

        public Integer getStationIdEd(){return this.stationIdEd;}

        private List<String> stationNameList;

        public List<String> getStationNameList(){return this.stationNameList;}


        private List<String> fuzzyStationName;

        public List<String> getFuzzyStationName(){return this.fuzzyStationName;}

        private List<String> rightFuzzyStationName;

        public List<String> getRightFuzzyStationName(){return this.rightFuzzyStationName;}
        private List<String> stationAddressList;

        public List<String> getStationAddressList(){return this.stationAddressList;}


        private List<String> fuzzyStationAddress;

        public List<String> getFuzzyStationAddress(){return this.fuzzyStationAddress;}

        private List<String> rightFuzzyStationAddress;

        public List<String> getRightFuzzyStationAddress(){return this.rightFuzzyStationAddress;}
        private List<java.time.LocalDateTime> createTimeList;

        public List<java.time.LocalDateTime> getCreateTimeList(){return this.createTimeList;}

        private java.time.LocalDateTime createTimeSt;

        private java.time.LocalDateTime createTimeEd;

        public java.time.LocalDateTime getCreateTimeSt(){return this.createTimeSt;}

        public java.time.LocalDateTime getCreateTimeEd(){return this.createTimeEd;}

        private List<java.time.LocalDateTime> updateTimeList;

        public List<java.time.LocalDateTime> getUpdateTimeList(){return this.updateTimeList;}

        private java.time.LocalDateTime updateTimeSt;

        private java.time.LocalDateTime updateTimeEd;

        public java.time.LocalDateTime getUpdateTimeSt(){return this.updateTimeSt;}

        public java.time.LocalDateTime getUpdateTimeEd(){return this.updateTimeEd;}


        public ConditionBuilder stationIdBetWeen(Integer stationIdSt,Integer stationIdEd){
            this.stationIdSt = stationIdSt;
            this.stationIdEd = stationIdEd;
            return this;
        }

        public ConditionBuilder stationIdGreaterEqThan(Integer stationIdSt){
            this.stationIdSt = stationIdSt;
            return this;
        }
        public ConditionBuilder stationIdLessEqThan(Integer stationIdEd){
            this.stationIdEd = stationIdEd;
            return this;
        }


        public ConditionBuilder stationIdList(Integer ... stationId){
            this.stationIdList = solveNullList(stationId);
            return this;
        }

        public ConditionBuilder stationIdList(List<Integer> stationId){
            this.stationIdList = stationId;
            return this;
        }

        public ConditionBuilder fuzzyStationName (List<String> fuzzyStationName){
            this.fuzzyStationName = fuzzyStationName;
            return this;
        }

        public ConditionBuilder fuzzyStationName (String ... fuzzyStationName){
            this.fuzzyStationName = solveNullList(fuzzyStationName);
            return this;
        }

        public ConditionBuilder rightFuzzyStationName (List<String> rightFuzzyStationName){
            this.rightFuzzyStationName = rightFuzzyStationName;
            return this;
        }

        public ConditionBuilder rightFuzzyStationName (String ... rightFuzzyStationName){
            this.rightFuzzyStationName = solveNullList(rightFuzzyStationName);
            return this;
        }

        public ConditionBuilder stationNameList(String ... stationName){
            this.stationNameList = solveNullList(stationName);
            return this;
        }

        public ConditionBuilder stationNameList(List<String> stationName){
            this.stationNameList = stationName;
            return this;
        }

        public ConditionBuilder fuzzyStationAddress (List<String> fuzzyStationAddress){
            this.fuzzyStationAddress = fuzzyStationAddress;
            return this;
        }

        public ConditionBuilder fuzzyStationAddress (String ... fuzzyStationAddress){
            this.fuzzyStationAddress = solveNullList(fuzzyStationAddress);
            return this;
        }

        public ConditionBuilder rightFuzzyStationAddress (List<String> rightFuzzyStationAddress){
            this.rightFuzzyStationAddress = rightFuzzyStationAddress;
            return this;
        }

        public ConditionBuilder rightFuzzyStationAddress (String ... rightFuzzyStationAddress){
            this.rightFuzzyStationAddress = solveNullList(rightFuzzyStationAddress);
            return this;
        }

        public ConditionBuilder stationAddressList(String ... stationAddress){
            this.stationAddressList = solveNullList(stationAddress);
            return this;
        }

        public ConditionBuilder stationAddressList(List<String> stationAddress){
            this.stationAddressList = stationAddress;
            return this;
        }

        public ConditionBuilder createTimeBetWeen(java.time.LocalDateTime createTimeSt,java.time.LocalDateTime createTimeEd){
            this.createTimeSt = createTimeSt;
            this.createTimeEd = createTimeEd;
            return this;
        }

        public ConditionBuilder createTimeGreaterEqThan(java.time.LocalDateTime createTimeSt){
            this.createTimeSt = createTimeSt;
            return this;
        }
        public ConditionBuilder createTimeLessEqThan(java.time.LocalDateTime createTimeEd){
            this.createTimeEd = createTimeEd;
            return this;
        }


        public ConditionBuilder createTimeList(java.time.LocalDateTime ... createTime){
            this.createTimeList = solveNullList(createTime);
            return this;
        }

        public ConditionBuilder createTimeList(List<java.time.LocalDateTime> createTime){
            this.createTimeList = createTime;
            return this;
        }

        public ConditionBuilder updateTimeBetWeen(java.time.LocalDateTime updateTimeSt,java.time.LocalDateTime updateTimeEd){
            this.updateTimeSt = updateTimeSt;
            this.updateTimeEd = updateTimeEd;
            return this;
        }

        public ConditionBuilder updateTimeGreaterEqThan(java.time.LocalDateTime updateTimeSt){
            this.updateTimeSt = updateTimeSt;
            return this;
        }
        public ConditionBuilder updateTimeLessEqThan(java.time.LocalDateTime updateTimeEd){
            this.updateTimeEd = updateTimeEd;
            return this;
        }


        public ConditionBuilder updateTimeList(java.time.LocalDateTime ... updateTime){
            this.updateTimeList = solveNullList(updateTime);
            return this;
        }

        public ConditionBuilder updateTimeList(List<java.time.LocalDateTime> updateTime){
            this.updateTimeList = updateTime;
            return this;
        }

        private <T>List<T> solveNullList(T ... objs){
            if (objs != null){
            List<T> list = new ArrayList<>();
                for (T item : objs){
                    if (item != null){
                        list.add(item);
                    }
                }
                return list;
            }
            return null;
        }

        public ConditionBuilder build(){return this;}
    }

    public static class Builder {

        private test obj;

        public Builder(){
            this.obj = new test();
        }

        public Builder stationId(Integer stationId){
            this.obj.setStationId(stationId);
            return this;
        }
        public Builder stationName(String stationName){
            this.obj.setStationName(stationName);
            return this;
        }
        public Builder stationAddress(String stationAddress){
            this.obj.setStationAddress(stationAddress);
            return this;
        }
        public Builder createTime(java.time.LocalDateTime createTime){
            this.obj.setCreateTime(createTime);
            return this;
        }
        public Builder updateTime(java.time.LocalDateTime updateTime){
            this.obj.setUpdateTime(updateTime);
            return this;
        }
        public test build(){return obj;}
    }

}
